package dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import pojo.CourseM;

import java.util.List;

@Repository
public interface AddCourseMapper {

    @Insert("insert into course_m (id,name,book) values (#{id},#{name},#{book})")
    int addCourse(CourseM courseM);

    @Select("select * from course_m where name like #{name}")
    List<CourseM> getAll(String name);

    @Select("select * from course_m")
    List<CourseM> getAllByArray();

    @Delete("delete from course_m where id=#{id}")
    Integer deleteCourse(String id);

}
